<% for article in @articles %>
  <h2><%= h article.title %> 
  <% if authenticated? -%>
    <%= link_to 'delete', url(:controller => 'articles', :action => 'destroy', :id => article.id) %>
    <%= link_to 'edit', url(:controller => 'articles', :action => 'edit', :id => article.id) %>
  </h2>
  <% end -%>
  <p><%=  RedCloth.new(article.content).to_html %></p>
<% end %>

<% if authenticated? -%>
<p>
  <%= link_to 'Add new article', url(:controller => 'articles', :action => 'new') %> &nbsp;&nbsp;|&nbsp;&nbsp;
  <%= link_to 'Admin', url(:controller => "admin") %>
</p>

<% end -%>